//
//  MPViewController.m
//  C17
//
//  Created by dllo on 16/3/15.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "MPViewController.h"

@interface MPViewController ()<UIWebViewDelegate>
@property (weak, nonatomic) IBOutlet UIWebView *webVIew;

@end

@implementation MPViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.title=self.webViewName;
    
    UIButton *button=[UIButton buttonWithType:UIButtonTypeCustom];
    button.frame=CGRectMake(0, 0, 25, 25);
    [button setImage:[UIImage imageNamed:@"iconfont-fanhui.png"] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.leftBarButtonItem=[[UIBarButtonItem alloc] initWithCustomView:button];
    
    self.webVIew.scrollView.bounces=NO;
    
    // 创建URL
    NSURL *url = [NSURL URLWithString:self.webViewUrl];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [self.webVIew loadRequest:request];
    
    //self.webVIew.delegate=self;
}

-(void)click:(UIButton *)button{
    [self.navigationController popViewControllerAnimated:YES];
}
//开始加载
- (void)webViewDidStartLoad:(UIWebView *)webView{
//    HUD = [[MBProgressHUD alloc]initWithView:self.view];
//    [self.view addSubview:HUD];
//    HUD.dimBackground=YES;
//    HUD.labelText=@"请稍等";
//    [HUD showAnimated:YES whileExecutingBlock:^{
//    } completionBlock:^{
//    }];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
